package com.itheima.fifth.controller;


import com.carkeeper.storebill.pojo.StoreBill;
import com.itheima.fifth.service.HomepageService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/homepage")
@Api(tags = "主页模块")
public class HomepageController {

    @Autowired
    private HomepageService homepageService;
    @GetMapping("/{id}")
    public StoreBill findById(@PathVariable("id")String id){
        return homepageService.findById(id);
    }

    @GetMapping("/search" )
    public List<StoreBill> findList(@RequestParam Map searchMap){
        List<StoreBill> list = homepageService.findList(searchMap);
        return list;
    }
}
